package com.hanserwei.community.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hanserwei.community.entity.po.Menu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MenuMapper extends BaseMapper<Menu> {
    List<Menu> queryMenuByUserName(String userName);

    List<Menu> queryMenuByRole(String role);

    void deleteRoleMenu(Integer roleId);

    void addRoleMenu(@Param("roleId") Integer roleId,@Param("menuIds") List<Integer> menuIds);

    /**
     * 检查菜单是否有角色关联
     */
    boolean checkMenuRoleAssociation(@Param("menuId") Integer menuId);
}